home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / docobj / iadvsink.cpp < prev    next >
C/C++ Source or Header  |  1995-11-22  |  2KB  |  122 lines

  1. /*
  2.  * IADVSINK.CPP
  3.  * IAdviseSink for Document Objects CSite class
  4.  *
  5.  * Copyright (c)1995 Microsoft Corporation, All Rights Reserved
  6.  * Kraig Brockschmidt, kraigb@microsoft.com
  7.  */
  8.  
  9.  
  10. #include "framer.h"
  11.  
  12.  
  13. /*
  14.  * CImpIAdviseSink::CImpIAdviseSink
  15.  * CImpIAdviseSink::~CImpIAdviseSink
  16.  *
  17.  * Parameters (Constructor):
  18.  *  pSite           PCSite of the site we're in.
  19.  *  pUnkOuter       LPUNKNOWN to which we delegate.
  20.  */
  21.  
  22. CImpIAdviseSink::CImpIAdviseSink(PCSite pSite
  23.     , LPUNKNOWN pUnkOuter)
  24.     {
  25.     m_cRef=0;
  26.     m_pSite=pSite;
  27.     m_pUnkOuter=pUnkOuter;
  28.     return;
  29.     }
  30.  
  31. CImpIAdviseSink::~CImpIAdviseSink(void)
  32.     {
  33.     return;
  34.     }
  35.  
  36.  
  37.  
  38.  
  39. /*
  40.  * CImpIAdviseSink::QueryInterface
  41.  * CImpIAdviseSink::AddRef
  42.  * CImpIAdviseSink::Release
  43.  *
  44.  * Purpose:
  45.  *  IUnknown members for CImpIAdviseSink object.
  46.  */
  47.  
  48. STDMETHODIMP CImpIAdviseSink::QueryInterface(REFIID riid, void **ppv)
  49.     {
  50.     return m_pUnkOuter->QueryInterface(riid, ppv);
  51.     }
  52.  
  53.  
  54. STDMETHODIMP_(ULONG) CImpIAdviseSink::AddRef(void)
  55.     {
  56.     ++m_cRef;
  57.     return m_pUnkOuter->AddRef();
  58.     }
  59.  
  60. STDMETHODIMP_(ULONG) CImpIAdviseSink::Release(void)
  61.     {
  62.     --m_cRef;
  63.     return m_pUnkOuter->Release();
  64.     }
  65.  
  66.  
  67.  
  68. /*
  69.  * Unused members in CImpIAdviseSink
  70.  *  OnDataChange
  71.  *  OnViewChange
  72.  *  OnRename
  73.  *  OnSave
  74.  */
  75.  
  76. STDMETHODIMP_(void) CImpIAdviseSink::OnDataChange(LPFORMATETC pFEIn
  77.     , LPSTGMEDIUM pSTM)
  78.     {
  79.     return;
  80.     }
  81.  
  82. STDMETHODIMP_(void) CImpIAdviseSink::OnViewChange(DWORD dwAspect
  83.     , LONG lindex)
  84.     {    
  85.     return;
  86.     }
  87.  
  88. STDMETHODIMP_(void) CImpIAdviseSink::OnRename(LPMONIKER pmk)
  89.     {
  90.     return;
  91.     }
  92.  
  93. STDMETHODIMP_(void) CImpIAdviseSink::OnSave(void)
  94.     {
  95.     return;
  96.     }
  97.  
  98.  
  99.  
  100.  
  101. /*
  102.  * CImpIAdviseSink::OnClose
  103.  *
  104.  * Purpose:
  105.  *  Informs the advise sink that the OLE object has closed and is
  106.  *  no longer bound in any way.  We use this to do a File/Close
  107.  *  to delete the object since we don't hold onto any.
  108.  *
  109.  * Parameters:
  110.  *  None
  111.  *
  112.  * Return Value:
  113.  *  None
  114.  */
  115.  
  116. STDMETHODIMP_(void) CImpIAdviseSink::OnClose(void)
  117.     {
  118.     //This does the same as File/Close
  119.     m_pSite->m_pFR->Close();
  120.     return;
  121.     }
  122.